[all packages]
[package pizza.lang]
[class hierarchy]
[index]
public final class pizza.lang.ListBuffer<A>
(source file: pizza/lang/ListBuffer.pizza)
java.lang.Object
|
+----pizza.lang.ListBuffer<A>
The pure class interface.
public final class ListBuffer<A>
-
This Class is a growable buffer for lists. It's modelled after class
java.lang.StringBuffer. It is mainly used to create Lists.
Note that the method toList() does not create a copy of the
internal buffer. Instead the buffer is marked as shared. Any
further changes to the buffer will cause a copy to be made.
- Parameters:
- A - the type of elements to store in the ListBuffer
- See also:
- List

ListBuffer()
-
Constructs an empty List buffer.

append(A)
- Appends a new element to the end and returns the buffer.
If the buffer was shared a copy of
elements()
- Returns an enumeration of all elements.
getAt(int)
-
Returns an element of the buffer.
insert(int, A)
-
Inserts an element into this buffer.
length()
-
Returns the length (element count) of the buffer.
prepend(A)
-
Prepends an element to the beginning of this buffer.
remove(int)
- Removes first `n' elements in this buffer.
setAt(int, A)
-
Updates an element in the buffer.
setLength(int)
- Truncates buffer to a maximum of `n' elements.
toList()
-
Converts to a List representing the data in the buffer.
toString()
-
Returns a string representation of this buffer.

ListBuffer
public ListBuffer();
-
Constructs an empty List buffer.

length
public int length();
-
Returns